package com.lingying.caiwudailikehudaun.utils;

import org.jasypt.util.text.BasicTextEncryptor;

public class JasyptUtil {
    /**
     * @param salt 加盐 盐值
     * @param userName 账号
     * @param Password 密码
     */
    public static void getJasypt(String salt , String userName , String Password){
        BasicTextEncryptor textEncryptor = new BasicTextEncryptor();
        //加密所需的salt(盐)
        textEncryptor.setPassword(salt);
        //要加密的数据（数据库的用户名或密码）
        String username = textEncryptor.encrypt(userName);
        String password = textEncryptor.encrypt(Password);
        System.out.println("username:"+username);
        System.out.println("password:"+password);
    }

    public static void main(String[] args) {
        getJasypt("lingying.ai","root","lingying@@@");
    }
}
